import { Model, Post, Get, Put, Delete } from "@xuekl/cli-core/annotate";
import { GetListOut, GetByIdOut } from "./interface";
import { EmptyOut } from "@/service/common/interface";
import R from "@xuekl/cli-core/r";

@Model('/system/user')
export default class UserService {

    //获取列表
    @Get('/list')
    getList(res) {
        return new R<GetListOut>(res.code, res).result()
    }

    //获取详情
    @Get('/:id')
    getById(res) {
        return new R<GetByIdOut>(res.code, res).result()
    }

    //新增数据
    @Post()
    insert(res) {
        return new R<EmptyOut>(res.code, res).result()
    }

    //更新数据
    @Put()
    update(res) {
        return new R<EmptyOut>(res.code, res).result()
    }

    //删除数据
    @Delete('/:ids')
    delete(res) {
        return new R<EmptyOut>(res.code, res).result()
    }

    //复用示例
    @Post('/share')
    share(res) {
        return new R<EmptyOut>(res.code, res).result()
    }


    @Get('/')
    getRolePost(res) {

    }

    @Put('/changeStatus')
    statusChange(res) {
        return new R<EmptyOut>(res.code, res).result()
    }

}